        <%@ page import="com.kma.ncpractice2013.dao.OrderDAO" %>
<%@ page import="com.kma.ncpractice2013.model.Order" %>
        <%--
                  User: Viktor
                  Date: 09.10.13
                  Time: 8:06
                --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
<%

    try {
        String email = request.getParameter("email");
        String token = request.getParameter("token");

        OrderDAO dao = new OrderDAO();
        Order order = dao.getByConfirmationToken(token);
        if (order != null)
        {
            order.setConfirmed(Order.Confirmed);
            dao.update(order);
        }
        else
        {
            // TODO: to do something
            throw new Exception();
        }

    } catch (Exception e) {
        out.print("Something went wrong. Try again.");
    }
//    finally {
//        conn.close();
//    }
%>

Thanks you for your order.</h3>
<p/><a href="login.jsp">login</a>
</div>

</body>
</html>